/*
* File: webserver.h
* Version: 1.0
* Last modified on Fri Mars 07 2014 by group 5
* Members:
* Johan Forsblom, Johanna Carlsson, Dragana Todorovic, 
* Hampus Herbertsson, Robin Henriksson
* -----------------------------------------------------
* This interface provides functions for handeling the server.
*/

#ifndef _WEBSERVER_H
#define _WEBSERVER_H

/*
* Constants for the server status
* -----------------------------------------------------
*/
#define SERVER_ACTIVE 1
#define SERVER_INACTIVE 0

/* Struct for parameterdata which is sent to the http parser. */
typedef struct {
	char hostName[100];
	int clientSocket;
}parDataT;

/*
* Function: getServerStatus
* Usage: status = getServerStatus();
* -----------------------------------------------------
* This function returns the server status, active or inactive.
*/
int getServerStatus();

/*
* Function: setServerStatus
* Usage: setServerStatus();
* -----------------------------------------------------
* This function sets server status, active or inactive.
*/
void setServerStatus(int status);

/*
* Function: startServerSocket
* Usage: startServerSocket();
* -----------------------------------------------------
* This function starts the serversocket.
*/
void startServerSocket(SOCKET *serverSocket);

/*
* Function: closeServerSocket
* Usage: closeServerSocket();
* -----------------------------------------------------
* This function closes the serversocket.
*/
void closeServerSocket(SOCKET *serverSocket);

/*
* Function: getServerSocket
* Usage: socket = getServerSocket();
* -----------------------------------------------------
* This function returns the current serversocket.
*/
SOCKET* getServerSocket();

#endif